import React from "react";
import type { ReactNode } from "react";
import "./index.less";
import clsx from "clsx";

interface FloatingButtonProps {
  active?: boolean;
  onClick?: () => void;
  children?: ReactNode;
}

/**
 * 浮动按钮组件
 */
const FloatingButton: React.FC<FloatingButtonProps> = ({ active = false, onClick, children }) => {
  return (
    <div
      className={clsx("floating-button", {
        active: active,
      })}
      onClick={onClick}
    >
      <span className="floating-button-text">{children}</span>
    </div>
  );
};

export default FloatingButton;
